adjust QMimeDatabase implementation
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 3 Jun 2021 12:55:29 +0000 (13:55 +0100)
committerLisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
Thu, 3 Jun 2021 12:55:29 +0000 (13:55 +0100)
commit43baca53f460b3109ee2229dc7f69de7926042e2
treecae5b90984781ff6bc0df0b13d6b3925930038ae
parent06ef7c61541ded74e444291176855c443ffb4bac
adjust QMimeDatabase implementation

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=0cbbba2aa5b47224
Last-Update: 2021-05-18

When multiple globs match, and the result from magic sniffing is
unrelated to any of those globs, globs have priority and one of them
should be picked up.

This change also optimizes QMimeBinaryProvider::addFileNameMatches
to have the same logic as xdgmime for glob matching:
literals > extensions > other globs
As soon as one category matches, we can stop there.
This makes no difference in the overall results, in practice.

Gbp-Pq: Name mime_globs.diff
src/corelib/mimetypes/qmimedatabase.cpp
src/corelib/mimetypes/qmimeglobpattern.cpp
src/corelib/mimetypes/qmimeprovider.cpp